'use strict';
const path = require('path');
const webpack = require("webpack");
module.exports = {
  entry: {
    index:'./src/index.js',
    search:'./src/search.js'
  },
  output: {
    path: path.join(__dirname, 'dist'),
    filename:'[name].js'
  },
  // mode:'production',
  mode:'development',
  module:{
    rules:[
      {test:/\.css$/,use:['style-loader','css-loader']},
      {test:/\.js$/,use:'babel-loader'},
      {test:/\.less$/,use:['style-loader','css-loader','less-loader']},
      // {test:/\.{png|svg|jpg|gif}$/,use:['file-loader']},
      {test:/\.{png|svg|jpg|gif}$/,use:[
        {
          loader:'url-loader',
          options:{
            limit:10240
          }
        }
      ]},
      {test:/\.{woff|woff2|eot|ttf|otf}$/,use:['file-loader']}
    ]
  },
  plugins:[
    new webpack.HotModuleReplacementPlugin()
  ],
  devServer:{
    contentBase:'./dist',
    hot:true
  }
};